package com.me.libgdx_test;

import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.scenes.scene2d.Actor;

public class ClassPreviewActor extends Actor{
	private Sprite sprite = null;
	Point location, dimension;
	//This class will create a bunch of actors for the selection screen when given sprites and coordinates
	ClassPreviewActor(Point location, Point dimension){
		this.location = new Point(location);
		this.dimension = new Point(dimension);
		setPosition(location.x, location.y);
		setSize(dimension.x, dimension.y);
	}
	public void set_sprite(Sprite sprite){
		if(this.sprite == null){
			this.sprite = new Sprite();
		}
		this.sprite.set(sprite);
		this.sprite.setPosition(location.x, location.y);
		this.sprite.setSize(dimension.x, dimension.y);
	}
	public Sprite get_sprite(){
		return sprite;
	}
	@Override
	public void draw (SpriteBatch batch, float parentAlpha) {
		if(sprite != null){
			sprite.draw(batch);
		}
	}
	//Need to override the fire function here to put the actor in the preview window when clicked
}